using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace DataHelper.DAL
{
    public class EmailRecive
    {
private static  string m_trConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

       #region EmailReciveSelectAll
        public static SqlDataReader EmailReciveSelectAll(string strSearch="",int top = 1, int bottom = 20, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "EmailReciveSelectAllRows",strSearch,top,bottom);
            return SqlHelper.ExecuteReader(m_trConnectionString, "EmailReciveSelectAllRows",strSearch,top,bottom);
        }
        #endregion
       #region EmailReciveSelectRow
        public static SqlDataReader EmailReciveSelectRow(string Email, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
                return SqlHelper.ExecuteReader(ConnectionString, "EmailReciveSelectRow", Email);
            return SqlHelper.ExecuteReader(m_trConnectionString, "EmailReciveSelectRow", Email);
        }
        #endregion
       #region EmailReciveInsertRow
        public static void EmailReciveInsertRow(string Email, bool IsDeleted, DateTime CreatedDate, DateTime DeletedDate, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "EmailReciveInsertRow", Email, IsDeleted, CreatedDate, DeletedDate);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "EmailReciveInsertRow", Email, IsDeleted, CreatedDate, DeletedDate);
        }
        #endregion
       #region EmailReciveUpdateRow
        public static void EmailReciveUpdateRow(string Email, bool IsDeleted, DateTime CreatedDate, DateTime DeletedDate, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "EmailReciveUpdateRow", Email, IsDeleted, CreatedDate, DeletedDate);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "EmailReciveUpdateRow", Email, IsDeleted, CreatedDate, DeletedDate);
        }
        #endregion
       #region EmailReciveDeleteRow
        public static void EmailReciveDeleteRow(string Email, SqlTransaction ConnectionString = null)
        {
            if (ConnectionString != null)
            {
                SqlHelper.ExecuteNonQuery(ConnectionString, "EmailReciveDeleteRow", Email);
                return;
            }
            SqlHelper.ExecuteNonQuery(m_trConnectionString, "EmailReciveDeleteRow", Email);
        }
        #endregion

    }
}

